package com.tiandao.mofang.core.shimei;

import com.tiandao.mofang.core.RobotSingleton;
import com.tiandao.mofang.core.util.OpenBox;
import com.tiandao.mofang.ui.MFFrame;

import java.awt.*;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.util.Date;
import java.util.Random;

/**
 * 师妹自动排课
 */
public class PaiKe implements Runnable {
    /**
     * 课一排课坐标
     * robot.mouseMove(520,312); //课一选择框
     * robot.mouseMove(520,355);//课一诗词
     * robot.mouseMove(550,388);//课一书画
     * robot.mouseMove(550,408);//课一乐舞
     * robot.mouseMove(550,428);//课一古琴
     * robot.mouseMove(550,448);//课一围棋
     * robot.mouseMove(550,468);//课一玩耍
     * robot.mouseMove(550,488);//课一休息
     */
    private static int[][] CLASS_ONE = new int[][]{{550, 368}, {550, 388}, {550, 408}, {550, 428}, {550, 448}, {550, 468}, {550, 488}};
    /**
     * robot.mouseMove(550,380); //课二选择框
     * robot.mouseMove(550,420);//课二诗词
     * robot.mouseMove(550,440);//课二书画
     * robot.mouseMove(550,460);//课二乐舞
     * robot.mouseMove(550,480);//课二古琴
     * robot.mouseMove(550,500);//课二围棋
     * robot.mouseMove(550,520);//课二玩耍
     * robot.mouseMove(550,540);//课二休息
     */
    private static int[][] CLASS_TWO = new int[][]{{550, 420}, {550, 440}, {550, 460}, {550, 480}, {550, 500}, {550, 520}, {550, 540}};
    /**
     * robot.mouseMove(550,430);//课三选择框
     * robot.mouseMove(550,475);//课三诗词
     * robot.mouseMove(550,495);//课三书画
     * robot.mouseMove(550,515);//课三乐舞
     * robot.mouseMove(550,535);//课三古琴
     * robot.mouseMove(550,555);//课三围棋
     * robot.mouseMove(550,575);//课三玩耍
     * robot.mouseMove(550,595);//课三休息
     */
    private static int[][] CLASS_THR = new int[][]{{550, 475}, {550, 495}, {550, 515}, {550, 535}, {550, 555}, {550, 575}, {550, 595}};
    /**
     * robot.mouseMove(550,563); //课四选择框
     * robot.mouseMove(550,605);//课四轻功
     * robot.mouseMove(550,625);//课四打坐
     * robot.mouseMove(550,645);//课四套路
     * robot.mouseMove(550,665);//课四实战
     * robot.mouseMove(550,685);//课四射箭
     * robot.mouseMove(550,705);//课四玩耍
     * robot.mouseMove(550,725);//课四休息
     */
    private static int[][] CLASS_FOU = new int[][]{{550, 605}, {550, 625}, {550, 645}, {550, 665}, {550, 685}, {550, 705}, {550, 725}};
    /**
     * robot.mouseMove(550,618); //课五选择框
     * robot.mouseMove(550,660);//课五轻功
     * robot.mouseMove(550,680);//课五打坐
     * robot.mouseMove(550,700);//课五套路
     * robot.mouseMove(550,720);//课五实战
     * robot.mouseMove(550,740);//课五射箭
     * robot.mouseMove(550,760);//课五玩耍
     * robot.mouseMove(550,780);//课五休息
     */
    private static int[][] CLASS_FIV = new int[][]{{550, 660}, {550, 680}, {550, 700}, {550, 720}, {550, 740}, {550, 760}, {550, 780}};
    /**
     * robot.mouseMove(550,670); //课六选择框
     * robot.mouseMove(550,714);//课六轻功
     * robot.mouseMove(550,734);//课六打坐
     * robot.mouseMove(550,754);//课六套路
     * robot.mouseMove(550,774);//课六实战
     * robot.mouseMove(550,794);//课六射箭
     * robot.mouseMove(550,814);//课六玩耍
     * robot.mouseMove(550,834);//课六休息
     */
    private static int[][] CLASS_SIX = new int[][]{{550, 714}, {550, 734}, {550, 754}, {550, 774}, {550, 794}, {550, 814}, {550, 834}};
    public static int HAO_NUM = 1;
    private static Robot robot = RobotSingleton.getInstance();

    @Override
    public void run() {
        start();
    }

    /**
     * 第一次  	18
     * 第二次   	18
     * 第三次	18     		 疲劳54
     * 第四次	+3 -50 +9	   	 疲劳16
     * 第五次	18		34
     * 第六次	18		52
     * 第七次	+3 -50 +9		14
     * 第八次	18		32
     * 第九次	18		50
     * 第十次	+3 -50 +9		12
     * 第十一次  	18  		30
     * 第十二次   	18		48
     * 第十三次	+3 -50 +9		10
     * 第十四次  	18  		28
     * 第十五次   	18		46
     * 第十六次	+3 -50 +9		9
     * 第十七次  	18  		27
     * 第十八次   	18		45
     * 第十九次 	+6 -25 +9                	35
     * 第二十次	+6 -25 +9		25
     */
    public static void start() {
        try {
            //第一次全排
            MFFrame.textArea.append(new Date()+":    第一次排课开始!\n");
            allPai();
            Thread.sleep(1200000);
            youLi();
            MFFrame.textArea.append(new Date()+":    第一次排课结束!疲劳 +18\n");
            //第二次全排
            MFFrame.textArea.append(new Date()+":    第二次排课开始!\n");
            allPai();
            Thread.sleep(1200000);
            youLi();
            MFFrame.textArea.append(new Date()+":    第二次排课结束!疲劳 +18\n");
            //第三次全排
            MFFrame.textArea.append(new Date()+":    第三次排课开始!\n");
            allPai();
            Thread.sleep(1200000);
            youLi();
            MFFrame.textArea.append(new Date()+":    第三次排课结束!疲劳 +18\n");
            //第四次排四休二
            MFFrame.textArea.append(new Date()+":    第四次排课开始!\n");
            forPai();
            Thread.sleep(1200000);
            youLi();
            MFFrame.textArea.append(new Date()+":    第四次排课结束!疲劳 -38\n");
            //第五次全排
            MFFrame.textArea.append(new Date()+":    第五次排课开始!\n");
            allPai();
            Thread.sleep(1200000);
            youLi();
            MFFrame.textArea.append(new Date()+":    第五次排课结束!疲劳 +18\n");
            //第六次全排
            MFFrame.textArea.append(new Date()+":    第六次排课开始!\n");
            allPai();
            Thread.sleep(1200000);
            youLi();
            MFFrame.textArea.append(new Date()+":    第六次排课结束!疲劳 +18\n");
            //第七次排四休二
            MFFrame.textArea.append(new Date()+":    第七次排课开始!\n");
            forPai();
            Thread.sleep(1200000);
            youLi();
            MFFrame.textArea.append(new Date()+":    第七次排课结束!疲劳 -38\n");
            //第八次全排
            MFFrame.textArea.append(new Date()+":    第八次排课开始!\n");
            allPai();
            Thread.sleep(1200000);
            youLi();
            MFFrame.textArea.append(new Date()+":    第八次排课结束!疲劳 +18\n");
            //第九次全排
            MFFrame.textArea.append(new Date()+":    第九次排课开始!\n");
            allPai();
            Thread.sleep(1200000);
            youLi();
            MFFrame.textArea.append(new Date()+":    第九次排课结束!疲劳 +18\n");
            //第十次排四休二
            forPai();
            Thread.sleep(1200000);
            youLi();
            //第十一次全排
            allPai();
            Thread.sleep(1200000);
            youLi();
            //第十二次全排
            allPai();
            Thread.sleep(1200000);
            youLi();
            //第十三次排四休二
            forPai();
            Thread.sleep(1200000);
            youLi();
            //第十四次全排
            allPai();
            Thread.sleep(1200000);
            youLi();
            //第十五次全排
            allPai();
            Thread.sleep(1200000);
            youLi();
            //第十六次排四休二
            forPai();
            Thread.sleep(1200000);
            youLi();
            //第十七次全排
            allPai();
            Thread.sleep(1200000);
            youLi();
            //第十八次全排
            allPai();
            Thread.sleep(1200000);
            youLi();
            //第十九次排五休一
            fivPai();
            Thread.sleep(1200000);
            youLi();
            //第二十次排五休一
            fivPai();
            Thread.sleep(1200000);
            youLi();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    //六次全排不休息
    public static void allPai() {
        try {
            OpenWindow();
            //点开排课
            Thread.sleep(3000);
            robot.mouseMove(933, 672);
            Thread.sleep(1500);
            robot.mousePress(InputEvent.BUTTON1_MASK);
            robot.mouseRelease(InputEvent.BUTTON1_MASK);
            Thread.sleep(3000);
            //课一二三四五六选择
            Random random = new Random();
            int a = 0;
            for (int i = 0; i < 6; i++) {
                switch (i) {
                    case 0:
                        //课一选择
                        Thread.sleep(1500);
                        robot.mouseMove(520, 312); //课一选择框
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        // 随机五个数
                        a = random.nextInt(5);
                        if (a == 0) {
                            Thread.sleep(1500);
                            robot.mouseMove(520,355);//课一诗词
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 1) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 375);//课一书画
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 2) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 395);//课一乐舞
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 3) {
                            Thread.sleep(1500);
                            robot.mouseMove(520,415);//课一古琴
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 4) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 435);//课一围棋
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        break;
                    case 1:
                        //课二选择
                        Thread.sleep(1500);
                        robot.mouseMove(520, 367); //课二选择框
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        // 随机五个数
                        a = random.nextInt(5);
                        if (a == 0) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 407);//课二诗词
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 1) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 427);//课二书画
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 2) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 447);//课二乐舞
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 3) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 467);//课二古琴
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 4) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 487);//课二围棋
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        break;
                    case 2:
                        Thread.sleep(1500);
                        robot.mouseMove(520, 417); //课三选择框
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        // 随机五个数
                        a = random.nextInt(5);
                        if (a == 0) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 462);//课三诗词
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 1) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 482);//课三书画
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 2) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 502);//课三乐舞
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 3) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 522);//课三古琴
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 4) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 542);//课三围棋
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        break;
                    case 3:
                        Thread.sleep(1500);
                        robot.mouseMove(520, 550);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        // 随机五个数
                        a = random.nextInt(5);
                        if (a == 0) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 592);//课四轻功
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 1) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 612);//课四打坐
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 2) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 632);//课四套路
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 3) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 652);//课四实战
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 4) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 672);//课四射箭
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        break;
                    case 4:
                        Thread.sleep(1500);
                        robot.mouseMove(520, 605); //课五选择框
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        // 随机五个数
                        a = random.nextInt(5);
                        if (a == 0) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 647);//课五诗词
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 1) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 667);//课五书画
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 2) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 687);//课五乐舞
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 3) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 707);//课五古琴
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 4) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 727);//课五围棋
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        break;
                    case 5:
                        Thread.sleep(1500);
                        robot.mouseMove(520, 657); //课六选择框
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        // 随机五个数
                        a = random.nextInt(5);
                        if (a == 0) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 700);//课六轻功
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 1) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 720);//课六书画
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 2) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 740);//课六乐舞
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 3) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 760);//课六古琴
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 4) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 780);//课六围棋
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                }
            }
            //确定按钮
            Thread.sleep(2000);
            robot.mouseMove(960, 730);
            Thread.sleep(1500);
            robot.mousePress(InputEvent.BUTTON1_MASK);
            robot.mouseRelease(InputEvent.BUTTON1_MASK);
            //关闭
            CloseWindow();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    //休息两次 拍四次
    public static void forPai() {
        try {
            OpenWindow();
            //点开排课
            Thread.sleep(3000);
            robot.mouseMove(933, 672);
            Thread.sleep(1500);
            robot.mousePress(InputEvent.BUTTON1_MASK);
            robot.mouseRelease(InputEvent.BUTTON1_MASK);
            Thread.sleep(3000);
            //课一二三四五六选择
            Random random = new Random();
            int a = 0;
            for (int i = 0; i < 6; i++) {
                switch (i) {
                    case 0:
                        //课一选择
                        Thread.sleep(1500);
                        robot.mouseMove(520, 312); //课一选择框
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        // 随机五个数
                        a = random.nextInt(5);
                        if (a == 0) {
                            Thread.sleep(1500);
                            robot.mouseMove(520,355);//课一诗词
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 1) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 375);//课一书画
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 2) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 395);//课一乐舞
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 3) {
                            Thread.sleep(1500);
                            robot.mouseMove(520,415);//课一古琴
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 4) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 435);//课一围棋
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        break;
                    case 1:
                        //课二选择
                        Thread.sleep(1500);
                        robot.mouseMove(520, 367); //课二选择框
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mouseMove(520, 527);//课二休息
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        break;
                    case 2:
                        Thread.sleep(1500);
                        robot.mouseMove(520, 417); //课三选择框
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);

                        Thread.sleep(1500);
                        robot.mouseMove(520, 582);//课三休息
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        break;
                    case 3:
                        Thread.sleep(1500);
                        robot.mouseMove(520, 550);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        // 随机五个数
                        a = random.nextInt(5);
                        if (a == 0) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 592);//课四轻功
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 1) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 612);//课四打坐
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 2) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 632);//课四套路
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 3) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 652);//课四实战
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 4) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 672);//课四射箭
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        break;
                    case 4:
                        Thread.sleep(1500);
                        robot.mouseMove(520, 605); //课五选择框
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        // 随机五个数
                        a = random.nextInt(5);
                        if (a == 0) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 647);//课五诗词
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 1) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 667);//课五书画
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 2) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 687);//课五乐舞
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 3) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 707);//课五古琴
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 4) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 727);//课五围棋
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        break;
                    case 5:
                        Thread.sleep(1500);
                        robot.mouseMove(520, 657); //课六选择框
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        // 随机五个数
                        a = random.nextInt(5);
                        if (a == 0) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 700);//课六轻功
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 1) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 720);//课六书画
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 2) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 740);//课六乐舞
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 3) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 760);//课六古琴
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 4) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 780);//课六围棋
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                }
            }
            //确定按钮
            Thread.sleep(2000);
            robot.mouseMove(960, 730);
            Thread.sleep(1500);
            robot.mousePress(InputEvent.BUTTON1_MASK);
            robot.mouseRelease(InputEvent.BUTTON1_MASK);
            //关闭
            CloseWindow();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    //休息一次 拍五次
    public static void fivPai() {
        try {
            OpenWindow();
            //点开排课
            Thread.sleep(3000);
            robot.mouseMove(933, 672);
            Thread.sleep(1500);
            robot.mousePress(InputEvent.BUTTON1_MASK);
            robot.mouseRelease(InputEvent.BUTTON1_MASK);
            Thread.sleep(3000);
            //课一二三四五六选择
            Random random = new Random();
            int a = 0;
            for (int i = 0; i < 6; i++) {
                switch (i) {
                    case 0:
                        //课一选择
                        Thread.sleep(1500);
                        robot.mouseMove(520, 312); //课一选择框
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        // 随机五个数
                        a = random.nextInt(5);
                        if (a == 0) {
                            Thread.sleep(1500);
                            robot.mouseMove(520,355);//课一诗词
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 1) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 375);//课一书画
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 2) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 395);//课一乐舞
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 3) {
                            Thread.sleep(1500);
                            robot.mouseMove(520,415);//课一古琴
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 4) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 435);//课一围棋
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        break;
                    case 1:
                        //课二选择
                        Thread.sleep(1500);
                        robot.mouseMove(520, 367); //课二选择框
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        // 随机五个数
                        a = random.nextInt(5);
                        if (a == 0) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 407);//课二诗词
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 1) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 427);//课二书画
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 2) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 447);//课二乐舞
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 3) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 467);//课二古琴
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 4) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 487);//课二围棋
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        break;
                    case 2:
                        Thread.sleep(1500);
                        robot.mouseMove(520, 417); //课三选择框
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);

                        Thread.sleep(1500);
                        robot.mouseMove(520, 582);//课三休息
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        break;
                    case 3:
                        Thread.sleep(1500);
                        robot.mouseMove(520, 550);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        // 随机五个数
                        a = random.nextInt(5);
                        if (a == 0) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 592);//课四轻功
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 1) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 612);//课四打坐
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 2) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 632);//课四套路
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 3) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 652);//课四实战
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 4) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 672);//课四射箭
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        break;
                    case 4:
                        Thread.sleep(1500);
                        robot.mouseMove(520, 605); //课五选择框
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        // 随机五个数
                        a = random.nextInt(5);
                        if (a == 0) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 647);//课五诗词
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 1) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 667);//课五书画
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 2) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 687);//课五乐舞
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 3) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 707);//课五古琴
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 4) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 727);//课五围棋
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        break;
                    case 5:
                        Thread.sleep(1500);
                        robot.mouseMove(520, 657); //课六选择框
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        // 随机五个数
                        a = random.nextInt(5);
                        if (a == 0) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 700);//课六轻功
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 1) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 720);//课六书画
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 2) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 740);//课六乐舞
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 3) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 760);//课六古琴
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                        if (a == 4) {
                            Thread.sleep(1500);
                            robot.mouseMove(520, 780);//课六围棋
                            Thread.sleep(1500);
                            robot.mousePress(InputEvent.BUTTON1_MASK);
                            robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        }
                }
            }
            //确定按钮
            Thread.sleep(2000);
            robot.mouseMove(960, 730);
            Thread.sleep(1500);
            robot.mousePress(InputEvent.BUTTON1_MASK);
            robot.mouseRelease(InputEvent.BUTTON1_MASK);
            //关闭
            CloseWindow();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public static void duiHua(){
        Random ran = new Random();
        int b = ran.nextInt(3);
        try {
            if(b==0){
                robot.mouseMove(300, 445);
                Thread.sleep(1500);
                robot.mousePress(InputEvent.BUTTON1_MASK);
                robot.mouseRelease(InputEvent.BUTTON1_MASK);
            }
            if(b==1){
                robot.mouseMove(300, 490);
                Thread.sleep(1500);
                robot.mousePress(InputEvent.BUTTON1_MASK);
                robot.mouseRelease(InputEvent.BUTTON1_MASK);
            }
            if(b==2){
                robot.mouseMove(300, 540);
                Thread.sleep(1500);
                robot.mousePress(InputEvent.BUTTON1_MASK);
                robot.mouseRelease(InputEvent.BUTTON1_MASK);
            }

        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
    //关闭对话
    public static void closeDh(){
        try {
            Thread.sleep(1500);
            robot.mouseMove(530, 77);
            Thread.sleep(1500);
            robot.mousePress(InputEvent.BUTTON1_MASK);
            robot.mouseRelease(InputEvent.BUTTON1_MASK);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
    //排完课的游历
    public static void youLi() {
        //师妹对话框

        duiHua();
        OpenWindow();
        int q = 1;
        try {
            while (q <= 3) {
                Thread.sleep(3000);
                robot.mouseMove(933, 672);
                Thread.sleep(1500);
                robot.mousePress(InputEvent.BUTTON1_MASK);
                robot.mouseRelease(InputEvent.BUTTON1_MASK);
                Thread.sleep(3000);
                Random random = new Random();
                int a = random.nextInt(5);
                switch (a) {
                    case 0:
                        //明察暗访
                        robot.mouseMove(960, 477);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(3000);
                        robot.mouseMove(960, 637);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        duiHua();
                        Thread.sleep(1500);
                        robot.mouseMove(1020, 700);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        break;
                    case 1:
                        robot.mouseMove(960, 517);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(3000);
                        robot.mouseMove(960, 637);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        duiHua();
                        Thread.sleep(1500);
                        robot.mouseMove(1020, 700);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        break;
                    case 2:
                        robot.mouseMove(960, 557);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(3000);
                        robot.mouseMove(960, 637);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        duiHua();
                        Thread.sleep(1500);
                        robot.mouseMove(1020, 700);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        break;
                    case 3:
                        robot.mouseMove(960, 597);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(3000);
                        robot.mouseMove(960, 637);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        duiHua();
                        Thread.sleep(1500);
                        robot.mouseMove(1020, 700);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        break;
                    case 4:
                        robot.mouseMove(960, 637);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(3000);
                        robot.mouseMove(960, 637);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                        Thread.sleep(1500);
                        duiHua();
                        Thread.sleep(1500);
                        robot.mouseMove(1020, 700);
                        Thread.sleep(1500);
                        robot.mousePress(InputEvent.BUTTON1_MASK);
                        robot.mouseRelease(InputEvent.BUTTON1_MASK);
                }
                if(q==3){
                    closeDh();
                }
                q++;
            }
            CloseWindow();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
       fivPai();
    }

    //打开师妹窗口
    public static void OpenWindow() {
        try {
            Random random = new Random();
            int a = random.nextInt(2);
            Thread.sleep(5000);
            if (a == 0) {
                robot.keyPress(KeyEvent.VK_ALT);
                Thread.sleep(200);
                robot.keyPress(KeyEvent.VK_E);
                robot.keyRelease(KeyEvent.VK_E);
                Thread.sleep(200);
                robot.keyRelease(KeyEvent.VK_ALT);
                //成功打开
            }
            //a=1 鼠标操作
            if (a == 1) {
                //移动鼠标到师妹上并点击
                Thread.sleep(1000);
                robot.mouseMove(1835, 1030);
                Thread.sleep(1000);
                robot.mousePress(InputEvent.BUTTON1_MASK);
                robot.mouseRelease(InputEvent.BUTTON1_MASK);
                //成功打开
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    //关闭师妹窗口
    public static void CloseWindow() {
        try {
            Thread.sleep(1000);
            robot.mouseMove(1445, 230);
            Thread.sleep(1000);
            robot.mousePress(InputEvent.BUTTON1_MASK);
            robot.mouseRelease(InputEvent.BUTTON1_MASK);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
